package org.qq.util;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URISyntaxException;

import org.qq.ui.ServerJframe;

/**
 * 
 * project_name:QQ
 * package_name:org.qq.util
 * file_name:UserFile.java
 * @author Link
 * create_date:2015年8月29日上午12:04:46
 * modified_date:
 * description: 存储用户信息工具包
 *
 */
public class UserSaveFile {
	private File file = null;
	private BufferedWriter bw;
	
	
	
	public void registUserSave(String registstr){
		try {
			file = new File(UserSaveFile.class.getResource("/file/用户注册信息.txt").toURI());
		} catch (URISyntaxException e1) {
			e1.printStackTrace();
		}
		try {
			bw = new BufferedWriter(new FileWriter(file, true));//将信息添加到文本末尾
			bw.write(registstr+"\r\n");
		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			if(bw!=null){
				try {
					bw.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
}
